{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "e95e30f7",
   "metadata": {},
   "outputs": [],
   "source": [
    "#从python的模块库中调出datetime模块\n",
    "from datetime import datetime"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "376e686c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "datetime.datetime(2021, 9, 9, 22, 14, 10, 365371)"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "datetime.today()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "6c490630",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "This minute seems a little odd.\n"
     ]
    }
   ],
   "source": [
    "#课本上的代码（第一章，在奇数中选择特定的时间点）\n",
    "odds =[1,3,5,7,9,11,13,15,17,19,\n",
    "       21,23,25,27,29,31,33,35,37,39,\n",
    "       41,43,45,47,49,51,53,55,57,59]\n",
    "right_this_minute =datetime.today().minute\n",
    "if right_this_minute in odds:\n",
    "    print(\"This minute seems a little odd.\")\n",
    "    #如果时间分数在odds里面则输出This minute seems a little odd.\n",
    "else:\n",
    "    print(\"Not an odd minute \")\n",
    "    #否则的话（双数）就输出Not an odd minute。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "d493226d",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "4ca90d41",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "9e509a36",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
